package ${package1}.${package2}.${package3}.dao;

import ${package1}.${package2}.${package3}.pojo.${table.name2};
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

@Mapper
public interface ${table.name2}Mapper {
    <#if table.key != "">
    ${table.name2} selectByPrimaryKey(<#list table.columns as column><#if column.columnKey=='PRI'><#if column?counter!=1>,</#if>${column.javaType} ${column.variableName}</#if></#list>);
    </#if>
    /**
     * 参数接受三种情况
     *  1.start=null（注意不是空串）limit=null   ;执行语句会查询全部数据
     *  2.start=null limit != null  ;查询从0开始查询limit条语句
     *  3.都不为空，从start位置开始，查询limit语句条
     */
    List<${table.name2}> select${table.name2}s(Integer start,Integer limit);

<#if table.key != "">
    int deleteByPrimaryKey(<#list table.columns as column><#if column.columnKey=='PRI'><#if column?counter!=1>,</#if>${column.javaType} ${column.variableName}</#if></#list>);
</#if>
    int select${table.name2}Total();

    int insert(${table.name2} obj);

<#if table.key != "">
    int  insertByDynamic(${table.name2} obj);
</#if>

<#if table.key != "">
        int updateByPrimaryKey(${table.name2} obj);
</#if>

<#if table.key != "">
        int updateByPrimaryKeyDynamic(${table.name2} obj);
</#if>



}